<template>
  <div class="con">
    <p><el-input
        prefix-icon="el-icon-user"
        style="margin-top: 20px; width: 300px"
        v-model="username"
        placeholder="请输入用户名"
      />
    </p>

    <p>
      <el-input
        prefix-icon="el-icon-lock"
        style="margin-top: 20px; width: 300px"
        v-model="password"
        placeholder="请输入密码"
      />
    </p>

    <p><el-button style="margin-top: 20px" type="primary" @click="handleClick">登录</el-button></p>
  </div>
</template>

<script lang='ts'>
import { defineComponent, ref, reactive, toRefs, computed } from "vue";
export default defineComponent({
  setup() {
    let state = reactive({
      username: "",
      password: "",
    });

    let handleClick = () => {
      console.log(state.username);
      console.log(state.password);
    };

    return {
      ...toRefs(state),
      handleClick,
    };
  },
});
</script>

<style scoped >
</style>

